package test.utils;

import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.RandomAccessFile;

/**
 * Created with IntelliJ IDEA.
 *
 * @ project name : example
 * @ Author: XuLeHuang
 * @ Date: 2022/6/8 17:00
 * @ Description:
 */
public class FileUtils {

    public static byte[] readFileToByteArray(File configFile) throws IOException {
        int length = (int)configFile.length();
        byte[] bytes = new byte[length];
        FileInputStream in = new FileInputStream(configFile);
        for (int i = 0 ; i < length ; i++) {
            bytes[i] = (byte) in.read();
        }
        return bytes;
    }


}
